{% extends "base.html" %}
{% load extra_tags %}
{% load humanize %}
{% load extra_filters %}
{% block title %}{% spaceless %}首页{% endspaceless %}{% endblock %}
{% block meta %}<meta name="keywords" content="技术问答社区，中国程序员，编程技术社区，程序员社区，程序员论坛，程序员wiki，程序员博客" />
        <meta name="description" content="中国程序员的编程技术问答社区。我们做专业的、可协作编辑的技术问答社区。" />{% endblock %}
{% block forejs %}
       <script type="text/javascript">
        $().ready(function(){
            var tab_id = "{{ tab_id }}";
            $("#"+tab_id).attr('className',"on");
            $("#nav_questions").attr('className',"on");
        });

        </script>
{% endblock %}
{% block content %}
<div class="tabBar">
    <div class="headQuestions">问题列表</div>
    <div class="tabsA">
    	 <a id="latest" href="?sort=latest" title="最新更新的问题" >最新问题</a>
        <a id="hottest" href="?sort=hottest" title="被回复最多的问题" >热门问题</a>
        <a id="mostvoted" href="?sort=mostvoted" title="投票次数最多的问题" >最有价值的问题</a>
        <a id="all" href="/questions/" title="所有问题" >全部问题</a>
    </div>
</div>
<!-- 问题列表 -->
<div id="listA">
    {% for question in questions %}
    <div class="qstA">
        <h2>
            <a href="{{ question.get_absolute_url }}" title="{{ question.summary }}...">
            {{ question.get_question_title }}
            </a>
        </h2>
        <div class="stat">
            <table>
	            <tr>
                    <td><span class="num">{{ question.answer_count|intcomma }}</span> </td>
                    <td><span class="num">{{ question.score|intcomma }}</span> </td>
                    <td><span class="num">{{ question.view_count|cnprog_intword|safe }}</span> </td>
	            </tr>  
                <tr>
                    <td><span class="unit">回答</span></td>
                    <td><span class="unit">票数</span></td>
                    <td><span class="unit">浏览</span></td>
	            </tr> 
            </table>
        </div>
        <div class="summary">
            {{ question.summary }}...
        </div>
        {% if question.wiki %}
        <span class="from wiki">社区Wiki</span>
        <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>
        {% else %}
        <div class="from">
            {% comment %}{% gravatar question.last_activity_by 24 %}{% endcomment %}
            <span class="author"><a href="{{ question.last_activity_by.get_profile_url }}">{{ question.last_activity_by }}</a></span>
            <span class="score">{% get_score_badge question.last_activity_by %} </span>
            <span class="date" title="{{ question.last_activity_at }}">{% diff_date question.last_activity_at %}</span>
        </div>
        {% endif %}
        <div class="tags">
        {% for tag in question.tagname_list %}
        <a href="{% url forum.views.tag tag|urlencode %}" title="查看有关'{{ tag }}'的问题" rel="tag">{{ tag }}</a>
        {% endfor %}
        </div>
    </div>
    {% endfor %}
</div>
{% endblock %}

{% block sidebar %}
{% if not request.user.is_authenticated %}
<div class="boxA">
	<h3>CNProg欢迎您!</h3>
	<div class="body">
	  <p>CNProg是一个<strong>面向程序员</strong>的可协作编辑的<strong>开放源代码问答社区</strong>。</p>
	  <p> 您可以在这里提问各类<strong>程序技术问题</strong> - 问题不分语言和平台。 同时也希望您对力所能及的问题，给予您的宝贵答案。</p>
	  <div class="more"><a href="/about">关于本站 »</a></div>
	  <div class="more"><a href="/faq">FAQ »</a></div>
	</div>
</div>
{% endif %}
<div class="boxB">
	<h3>最新标签</h3>
	<div class="body">
         <p class="tagsbox">
        {% for tag in tags %}
            <a rel="tag" title="查看有关'{{ tag.name }}'的问题" href="{% url forum.views.tag tag.name|urlencode %}">{{ tag.name }}</a>
        {% endfor %}
        </p>
        <div class="more"><a href="/tags">受欢迎的标签 »</a> </div>
    </div>
</div>
<div class="boxB">
    <h3>最新奖牌</h3>
        <div class="body">
             <ul class="badge-list">
             {% for award in awards %}
                <li>
                <a href="/badges/{{award.badge_id}}/{{award.badge_name}}" title="{{ award.badge_description }}" class="medal">
                <span class="badge{{ award.badge_type }}">&#9679;</span>&nbsp;{{ award.badge_name }}</a> 授予
                <a href="/users/{{award.user_id}}/{{award.user_name}}">{{ award.user_name }}</a>
                </li>
            {% endfor %}
            </ul>
        	<div class="more"><a href="/badges/">所有奖牌 »</a> </div>
         </div>
</div>
<div id="feeds">
<a href="/feeds/rss" title="RSS订阅最新30个问题">订阅最新问题</a>
</div>
{% endblock %}
{% block tail %}
<div style="padding:5px 0 5px 5px;">
<span class="evenMore">在寻找更多问题吗？请查阅 <a href="/questions/">全部问题列表</a>，或者 <a href="/tags/">受欢迎的标签</a>。请帮助我们回答 <a href="/questions/unanswered">没有回答的问题</a>。</span>
</div>
{% endblock %}